package com.pattern.decorator.battercake.v2;

public class BattercakeTest {
    public static void main(String[] args) {
        Battercake battercake;
        //路边滩买一个鸡蛋
        battercake = new BaseBattercake();
        //煎饼有点小，想在加一个鸡蛋
        battercake =new EggDecorator(battercake);
        //再加一个鸡蛋
        battercake = new EggDecorator(battercake);
        //再加一个香肠
        battercake=new SausageDecorator(battercake);

        //跟静态代理最大的区别在于职责不同
        //静态代理不一定要满足 is a 的关系
        //静态代理会做功能增强，同一个职责变化不一样
        //装修器跟多考虑扩展
        System.out.println(battercake.getMsg()+",总价："+battercake.getPrice());
;    }
}
